{extend name="public/layout" /}
{block name="head"}{/block}
{block name="body"}

<body>
  <div class="container-fluid p-t-15">
    <div class="card">
      <div class="card-header">
        <h4>编辑碎片</h4>
      </div>
      <div class="card-body">
        <form class="form-horizontal" id="form" data-url="/system/patch/index.html">
          <div class="form-group">
            <label class="col-sm-2 col- control-label">碎片类型</label>
            <div class="col-sm-6">
              {:\\helper\\Form::_select('patch_type',$info.patch_type,[
              "id"=>"patch-type",
              "empty-option"=>"|请选择碎片类型",
              "datatype"=>"*",
              "disabled"=>"disabled",
              "items-data"=>$class,
              "items-key"=>"dict_code",
              "items-name"=>"dict_value"
              ])}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">碎片编码</label>
            <div class="col-sm-6">
              {:\\helper\\Form::_text('patch_sn',$info.patch_sn,[
              "datatype"=>"*"
              ])}
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">碎片标题</label>
            <div class="col-sm-6">
              {:\\helper\\Form::_text('patch_title',$info.patch_title,[
              "datatype"=>"*"
              ])}
            </div>
          </div>
          {eq name="info.patch_type" value="1"}
          <div class="form-group">
            <label class="col-sm-2 control-label">图片地址</label>
            <div class="col-sm-6">
              {:\\helper\\Form::_uploadImage('patch_content_1',$info.patch_content,[
              "data-theme"=>"single01"
              ])}
            </div>
          </div>
          {/eq}
          {eq name="info.patch_type" value="2"}
          <div class="patch-content patch-content-2">
            <div class="form-group">
              <label class="col-sm-2 control-label">图片地址</label>
              <div class="col-sm-6">
                {:\\helper\\Form::_uploadImages('patch_content_2',$info.patch_content,[
                "data-theme"=>"multi02"
                ])}
              </div>
            </div>
          </div>
          {/eq}
          {eq name="info.patch_type" value="3"}
          <div class="form-group">
            <label class="col-sm-2 control-label">代码</label>
            <div class="col-sm-8">
              {:\\helper\\Form::_ace('patch_content_3',$info.patch_content,[
              "data-theme"=>"tomorrow_night_eighties",
              "style"=>"height:320px"
              ])}
            </div>
          </div>
          {/eq}
          {eq name="info.patch_type" value="4"}
          <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-8">
              {:\\helper\\Form::_ckEditor('patch_content_4',$info.patch_content,[
              "data-theme"=>"tomorrow_night_eighties",
              "style"=>"height:320px"
              ])}
            </div>
          </div>
          {/eq}
          {eq name="info.patch_type" value="5"}
          <div class="patch-content patch-content-2">
            <div class="form-group">
              <label class="col-sm-2 control-label">附件内容</label>
              <div class="col-sm-6">
                {:\\helper\\Form::_uploadFiles('patch_content_5',$info.patch_content,[
                "data-theme"=>"multi03"
                ])}
              </div>
            </div>
          </div>
          {/eq}
          {eq name="info.patch_type" value="6"}
          <div class="patch-content patch-content-2">
            <div class="form-group">
              <label class="col-sm-2 control-label">列表内容</label>
              <div class="col-sm-6">
                {:\\helper\\Form::_inputGroup('patch_content_6',$info.patch_content,[
                'data-files'=>[
                'item01'=>['name'=>'键名','width'=>100,'inputOptions'=>['datatype'=>'*']],
                'item02'=>['name'=>'项目内容','width'=>200,'inputOptions'=>['datatype'=>'*']],
                'item03'=>['name'=>'备注项','width'=>200],
                ]
                ])}
              </div>
            </div>
          </div>
          {/eq}
          <div class="form-group">
            <label class="col-sm-2 control-label">排序</label>
            <div class="col-sm-6">
              {:\\helper\\Form::_number('show_order',$info.show_order,[
              "datatype"=>"n"
              ])}
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-10 col-sm-offset-2">
              <div class="pull-left">
                <button type="button" class="btn btn-primary btn-sub"><i class="mdi mdi-content-save"></i> 保存</button>
                <button type="button" class="btn btn-danger" onclick="helper.closeCurrent()"><i
                    class="mdi mdi-close"></i>
                  关闭
                </button>
              </div>
              <div class="pull-left m-l-15">
                <p class="error-msg"></p>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
  <script>
    formHelper.init();
    formHelper.subForm();
  </script>
</body>
{/block}